package lelouet.sh3d.plugins.sweetDatacenter.gui;

import javax.swing.JTabbedPane;

import lelouet.sh3d.plugins.sweetDatacenter.model.GridGraphicalBridge;

import com.eteks.sweethome3d.model.SelectionListener;

/**
 * This code was edited or generated using CloudGarden's Jigloo
 * SWT/Swing GUI Builder, which is free for non-commercial
 * use. If Jigloo is being used commercially (ie, by a corporation,
 * company or business for any purpose whatever) then you
 * should purchase a license for each developer using Jigloo.
 * Please visit www.cloudgarden.com for details.
 * Use of Jigloo implies acceptance of these licensing terms.
 * A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
 * THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
 * LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
 */
/**
 * The main plugin options : modify selected element, modify maps properties,
 * generate datamaps
 */
public class GeneralPropertiesPanel extends JTabbedPane {

	private static final long serialVersionUID = 1L;

	protected GridGraphicalBridge bridge = null;

	protected SelectedElementPane selectedElementPanel;

	protected MapManagementPanel generationPanel;

	public GeneralPropertiesPanel(GridGraphicalBridge bridge) {
		this.bridge = bridge;
		initGUI();
	}

	private void initGUI() {
		try {
			javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager
					.getSystemLookAndFeelClassName());
		} catch (Exception e) {
			e.printStackTrace();
		}
		{
			selectedElementPanel = new SelectedElementPane(bridge);
			addTab("selected", selectedElementPanel);
		}
		{
			generationPanel = new MapManagementPanel(bridge);
			addTab("generate maps", generationPanel);
		}
	}

	/** @return the listener to selection modifications in the home model */
	public SelectionListener[] getSelectionListener() {
		return new SelectionListener[] { selectedElementPanel.getControler() };
	}

}
